<template>
  <div class="about">
    <h1>This is an about page</h1>
    <h1>倒计时组件</h1>
    <button @click="getNowTime">点击获取当前时间</button>
    <p>现在时间：{{nowTime}}</p>
    <button @click="addTest">++</button>
    <button @click="doubleAdd">++++</button>
    <div>{{test}}</div>
    <div>
      <demo1 ref="demoDom" :nowTime="nowTime" :changeTest="addTest" @myclick="myClick"></demo1>
    </div>
  </div>
</template>

<script lang="ts">
import demo1 from "@/views/demo1.vue";
import { defineComponent, onMounted, ref } from "vue";
import { nowTime, getNowTime, test, addTest } from "./a";
export default defineComponent({
  setup() {
    const doubleAdd = (): void => {
      test.value += 2;
    };
    const demoDom = ref(null);
    onMounted(() => {
      console.log("chushihua");
    });
    const myClick = (e: string): void => {
      console.log(e);
      addTest();
    };
    return {
      nowTime,
      getNowTime,
      doubleAdd,
      addTest,
      test,
      demoDom,
      myClick,
    };
  },
  components: {
    demo1,
  },
});
</script>

<style lang="less">
</style>
